package com.lyf.springmvc.cmd;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//实现Controller的自定义控制类需要在web.xml中定义bean,以确认访问路径
public class Lu2Controller implements Controller {

    @Override
    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response) throws Exception {
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("date", "自定义");
        modelAndView.addObject("id", "自定义");
        modelAndView.setViewName("success");
        return modelAndView;
    }
}
